﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CopySniffer.UI.Core;
using CopySniffer.UI.Core.Views;

namespace CopySniffer.UI.Views.WindowsForms
{
    public class WindowsFormsViewFactory : IViewFactory
    {
        #region IViewFactory Members

        public TView CreateView<TView, TControler>() where TView : IView<TControler>
        {
            return (TView)Activator.CreateInstance(factoryTypes[typeof(TView)]);
        }

        #endregion

        private static readonly Dictionary<Type, Type> factoryTypes =
            new Dictionary<Type, Type>()
            {
                {typeof(IMainView), typeof(MainView)},
                {typeof(IEditorView), typeof(EditorView)},
                {typeof(IAboutView), typeof(AboutView)}
            };
    }
}
